package com.meitutest.autoscript;

import android.support.test.InstrumentationRegistry;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.UiSelector;

import org.junit.Before;
import org.junit.Test;

/**
 * Created by CrystalChen on 2017/12/20.
 */

public class SelfTest {
    UiDevice uiDevice;


    @Before
    public void before() {
        this.uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
        MyWatcher watcher = new MyWatcher(uiDevice);
        uiDevice.registerWatcher("mywatcher", watcher);
    }

    @Test
    public void test01() throws Exception {
        String weiXin_Plus="com.tencent.mm:id/aag";
        String weiXin_XiangCe="com.tencent.mm:id/p2";
        String weiXin_TuPianHeShiPin="com.tencent.mm:id/d1l";
        String weiXin_XuanZheKuang="com.tencent.mm:id/bpl";
        String weiXin_FaSongTuPian="com.tencent.mm:id/hd";
        Thread.sleep(1000);
        uiDevice.findObject(new UiSelector().resourceId(weiXin_Plus)).click();
        Thread.sleep(100);
        uiDevice.findObject(new UiSelector().resourceId(weiXin_XiangCe)).click();
        Thread.sleep(100);
        uiDevice.findObject(new UiSelector().resourceId(weiXin_TuPianHeShiPin)).click();
        Thread.sleep(100);

    }



}
